package cn;

import java.util.HashMap;

/**
 * @author Mxb
 * @version 1.0
 * @date 2020/9/2 11:37
 */
public class Test {
    public static void main(String[] args) {


    }

    public String AddLongInteger(String addend,String augend){


        return addend+augend;
    }

    public int[] twoSum(int[] nums, int target) {
        HashMap<Integer,Integer> m = new HashMap<>();

        for (int i = 0; i < nums.length; i++) {
            int a = target-nums[i];
            if (m.containsKey(a)){
                return new int[] {m.get(a),i};
            }
            m.put(nums[i],i);
        }
        throw new IllegalArgumentException("没有匹配");
    }
}
